The present invention relates to network techniques, and more specifically, to a method and system for accurately and completely playing back web operations that have been performed.
Currently, a large amount of applications exist as web applications, or require web interactions or information transmissions during the execution thereof. In order to test web applications, debug or modify those applications in accordance with user-reported error information occurred during application execution, it is necessary to play back web operations performed when those errors occurred. Web operations may comprise various types of inputs, for example, clicking a button on a webpage by a user (a DOM node event), submitting a HTTP request by a browser (a web request), or receiving a HTTP response returned by a server (a web response). When playing back web operations, it is required to ensure not only the input integrity of the web operations, but also the temporal sequence of various inputs involved in the web operations, otherwise, the previous web operation procedure cannot be played back accurately.
A particular example will be given below: assume there is a web 2.0 environment, with a table used in a dialog in that environment, in which a pull-down menu and a “submit” button are provided. A common web operation flow may comprise: (1) initiating a dialog by a user to show that table (act 1); (2) providing default values in the pull-down menu of the table, while dynamically retrieving some real-time contents from the server side to replace the original default values (web request 1→web response 1); (3) selecting a value by the user and clicking the “submit” button to submit the table (act 2→request 2→response 2). Thus, a normal operation flow abstracted from the web operations is “act 1→request 1→response 1→act 2→request 2→response 2”. During the web operation procedure, if a user clicks the “submit” button of the table without obtaining real-time contents from the server when the table is exactly displayed, the default values will be sent to the server side, and thus causing an error to be reported. A flow corresponding to actual web operations causing the reported error is “act 1→request 1→act 2→request 2→response 1→response 2”. In order to detect the reason of the user error, program testers and developers have to play back the same web operations of the user in the same input order, for the reason of the error occurred when the user runs the software is because of the varied input order of those web operations.
There are some technical solutions in the prior art for recording a web operation procedure, which can only record the correspondence between web requests and web responses. However, they can not record the temporal sequence of multiple web responses, and timeout constraints between web requests and web responses. In addition, DOM node events triggered by users can not be logged in the prior art. As a result, the accurate and complete playback of actual web operations cannot be implemented.